﻿using DDD.Application;
using DDD.Core;
using GoodsModule.IntegrationEvents;
using MediatR;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GoodsModule.Application.IntegrationEventsHandler
{
    public class GoodsCreatedIntegrationEventHandler(IMediator mediator, ILogger<GoodsCreatedIntegrationEventHandler> logger) 
        : IIntegrationEventHandler<GoodsCreatedIntegrationEvent>
    {
        public Task Handle(GoodsCreatedIntegrationEvent @event, CancellationToken cancellationToken = default)
        {
            //var cmd = new { @event.OrderId };
            //return mediator.Send(cmd);
            logger.LogInformation("商品创建集成事件处理器：{}","GoodsCreateIntegrationEventHandler.Handle");
            return Task.CompletedTask;
        }
    }
}
